package com.practice.pagehelper.controller;

import com.practice.pagehelper.entity.UserEntity;
import com.practice.pagehelper.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;

@RestController
@RequestMapping("/test/user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/queryPageUsers")
    public String queryPageUsers() {
        List<UserEntity> userEntities = userService.queryPageUser();
        Optional.ofNullable(userEntities).ifPresent(userEntityList -> {
        });
        return "query success";
    }
}
